<% has_design = has_design?(@assembly.ciId)
   new_path   = new_assembly_design_platform_component_attachment_path(@assembly, @platform, @component) %>
<%= section_panel('Attachments',
                  :width => 'single',
									:menu  => has_design && [link_to(icon('plus','Add'), new_path, :remote => true, :class => 'btn btn-mini')]) do %>
  <%= ci_list(@attachments, :new_link => link_to(icon('plus', 'Add Attachment...'), new_path, :remote => true)) do |builder, target| %>
    <% edit_path = edit_assembly_design_platform_component_attachment_path(@assembly, @platform, @component, target) %>
    <% builder.target link_to('', edit_path, :remote => true) %>
    <% builder.middle target.ciAttributes.attributes[:source] %>
    <% if has_design %>
      <% builder.menu do |ci| %>
        <%= link_to(icon('trash',' Delete'), assembly_design_platform_component_attachment_path(@assembly, @platform, @component, target), :remote => true, :method => :delete, :confirm => "Delete attachment '#{ci.ciName}'?") %>
      <% end %>
    <% end %>

  <% end %>
<% end %>
<div id="attachment_details"></div>
